<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@taglib uri="http://www.springframework.org/tags" prefix="spring"%>
<%@ include file="/WEB-INF/jsp/include.jsp"%>
<script>
 	function deleteFunction(frm){
 		var isDel = confirm("Bạn có muốn xóa tin tức này?");
 		if (isDel) {
 			return true;
 		} else {
 			return false;
 		}
 	}
</script>
<div id="content-block">
	<div id="breadcrumb">
		<div class="breadcrumb">
			<a href="listnotice.html">Thông báo</a>
		</div>
	</div>

	<div id="page-title">Thông báo</div>
	<c:if test="${not empty isAdmin}">
					<a href="addnotice.html">+</a>
	</c:if>
<div class="view view-uc-products-frontpage view-id-uc_products_frontpage view-display-id-block_1 view-dom-id-11">
				<div class="view-content">
					<table>
						<tr>
							<td>
				<c:forEach var="notice" items="${allNoticeList}">
					<a href="detailnotice.html?id=${notice.id}">${notice.name}</a>
					<c:if test="${not empty isAdmin}"> 
 									<form name="frmDel${notice.id}" action='delNotice.do' method="post"> 
										<input type="hidden" name="key" value="${notice.key}" /> 
										<input type="hidden" name="id" value="${notice.id}" /> 
										<button onclick='return deleteFunction("frmDel${notice.id}");'>-</button> 
									</form>
								</c:if>
					<p name="created_name"  style="color:#C0C0C0;font-size:12px;">${notice.created}</p>
				</c:forEach>
				</td>
				</tr>
				</table>
				</div>
				</div>
				
</div>
<script type="text/javascript" src="./js/date-format.js"></script>
